package com.ihelp.rest.mis.platform.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.ihelp.rest.mis.platform.service.AbnormaltimeService;
import com.ihelp.rest.mis.pojo.Abnormaltime;
import com.ihelp.rest.utils.HtmlUtil;

@Controller
@RequestMapping("/system/abnormaltime")
public class AbnormaltimeController {
	@Autowired
	private AbnormaltimeService abnormaltimeService;
	
	@RequestMapping("abnormaltimeList.do")
	public String abnormaltimeList(HttpServletRequest request){
		return "system/abnormaltime/abnormaltimeList";
	}
	
	@RequestMapping("jsonAbnormaltimePageList.do")
	public void jsonAbnormaltimePageList(HttpServletResponse response, Abnormaltime queryCondition,int page,int rows,String sort, String order){
		String json = this.abnormaltimeService.findAbnormaltimePage(queryCondition, page, rows, sort, order);
		HtmlUtil.writerJson(response, json);
	}
	
	@RequestMapping("doSaveAbnormaltime.do")
	public void doSaveAbnormaltime(HttpServletResponse response, Abnormaltime abnormaltime){
		String result = this.abnormaltimeService.saveAbnormaltime(abnormaltime);
		HtmlUtil.sendDirectToClient(response,result);
	}
	
	@RequestMapping("doDelAbnormaltime.do")
	public void doDelAbnormaltime(HttpServletResponse response, String ids){
		String result = this.abnormaltimeService.delAbnormaltime(ids);
		HtmlUtil.sendDirectToClient(response,result);
	}
}
